package com.stars.empoly.activity

import androidx.fragment.app.Fragment
import com.qmuiteam.qmui.widget.tab.QMUITab
import com.qmuiteam.qmui.widget.tab.QMUITabBuilder
import com.stars.empoly.R
import com.stars.empoly.base.MBTabActivity
import com.stars.empoly.databinding.ActivityAccountBinding
import com.stars.empoly.fragment.AccountBillFragment
import com.trailer.base.base.BRepository
import com.trailer.base.base.BViewModel

class AccountActivity : MBTabActivity<BViewModel<BRepository>, ActivityAccountBinding>() {


    override fun binding(): ActivityAccountBinding {
        return ActivityAccountBinding.inflate(layoutInflater)
    }



    override fun title(): String? {
        return getString(R.string.my_account)
    }

    override fun getPageItem(position: Int): Fragment {
        return if (position == 1) {
            AccountBillFragment()
        } else AccountBillFragment()
    }

    override fun getPageCount(): Int {
     //   return 2
        return 1
    }

    override fun createTabs(tabBuilder: QMUITabBuilder): Array<QMUITab> {

        val component = tabBuilder
                .setText(getString(R.string.bill))
                .build(context())
//        val util = tabBuilder
//                .setText(getText(R.string.analysis))
//                .build(context())

        //return arrayOf(component, util)

        return arrayOf(component)
    }
}
